(use-package helm
  :ensure t
  :init
  (require 'helm-config)
  (require 'helm-eshell)
  (setq helm-quick-update t
		helm-bookmark-show-location t
		helm-buffers-fuzzy-matching t
		helm-recentf-fuzzy-match t
		helm-locate-fuzzy-match t
		helm-lisp-fuzzy-completion t
		helm-input-idle-delay 0.01
		helm-echo-input-in-header-line t
		helm-ff-file-name-history-use-recentf t
		helm-move-to-line-cycle-in-source t
		helm-autoresize-max-height 0
		helm-autoresize-min-height 20)
  :config
  (helm-autoresize-mode 1)
  (helm-mode t)
  (add-to-list 'helm-sources-using-default-as-input 'helm-source-man-pages)
  (bind-keys :map helm-map
			 ("<tab>" . helm-execute-persistent-action)
			 ("C-i" . helm-select-action)
			 ("C-h" . delete-backward-char)
			 ("C-j" . helm-next-line)
			 ("C-k" . helm-previous-line)
			 ("M-y" . helm-show-kill-ring)
			 )
  (bind-keys :map helm-find-files-map
			 ("C-h" . delete-backward-char))
  (bind-keys :map global-map
			 ("C-c h" . helm-command-prefix)
			 ("C-x b" . helm-for-files)
			 ("C-x C-f" . helm-find-files)
			 ("M-x" . helm-M-x)
			 ("M-y" . helm-show-kill-ring))
  (add-hook 'eshell-mode-hook
          #'(lambda ()
              (define-key eshell-mode-map (kbd "C-c C-l")  'helm-eshell-history)
			 ;; (define-key eshell-mode-map (kbd "C-p") 'eshell-previous-input)
			 ;; (define-key eshell-mode-map (kbd "C-n") 'eshell-next-input)
			  ))
  (bind-keys :map shell-mode-map
			 ("C-c C-l" . helm-comint-input-ring))
  (bind-keys :map minibuffer-local-map
			 ("C-c C-l" . helm-minibuffer-history))
)


(provide 'init-helm)  